home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / fork.man < prev    next >
Encoding:
Text File  |  1988-12-31  |  2.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. FORK                  C Library Procedures                   FORK
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      fork - create a new process
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ppiidd == ffoorrkk(())
  13.      iinntt ppiidd;;
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      _F_o_r_k causes creation of a new process.  The new process
  17.      (child process) is an exact copy of the calling process
  18.      except for the following:
  19.  
  20.           The child process has a unique process ID.
  21.  
  22.           The child process has a different parent process ID
  23.           (i.e., the process ID of the parent process).
  24.  
  25.           The child process has its own copy of the parent's
  26.           descriptors.  These descriptors reference the same
  27.           underlying objects, so that, for instance, file
  28.           pointers in file objects are shared between the child
  29.           and the parent, so that an _l_s_e_e_k(2) on a descriptor in
  30.           the child process can affect a subsequent _r_e_a_d or _w_r_i_t_e
  31.           by the parent.  This descriptor copying is also used by
  32.           the shell to establish standard input and output for
  33.           newly created processes as well as to set up pipes.
  34.  
  35.           The child processes resource utilizations are set to 0;
  36.           see _s_e_t_r_l_i_m_i_t(2).
  37.  
  38. RREETTUURRNN VVAALLUUEE
  39.      Upon successful completion, _f_o_r_k returns a value of 0 to the
  40.      child process and returns the process ID of the child pro-
  41.      cess to the parent process.  Otherwise, a value of -1 is
  42.      returned to the parent process, no child process is created,
  43.      and the global variable _e_r_r_n_o is set to indicate the error.
  44.  
  45. EERRRROORRSS
  46.      _F_o_r_k will fail and no child process will be created if one
  47.      or more of the following are true:
  48.  
  49.      [EAGAIN]       The system-imposed limit on the total number
  50.                     of processes under execution would be
  51.                     exceeded.  This limit is configuration-
  52.                     dependent.
  53.  
  54.      [EAGAIN]       The system-imposed limit MAXUPRC
  55.                     (<_s_y_s/_p_a_r_a_m._h>) on the total number of
  56.                     processes under execution by a single user
  57.                     would be exceeded.
  58.  
  59.      [ENOMEM]       There is insufficient swap space for the new
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 22, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FORK                  C Library Procedures                   FORK
  71.  
  72.  
  73.  
  74.                     process.
  75.  
  76. SSEEEE AALLSSOO
  77.      execve(2), wait(2)
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 22, 1986                          2
  130.  
  131.  
  132.  
  133.